<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
	<title>jsx</title>
</head>
<body>
    <div id="test1"></div>
    <div id="test2"></div>
    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>
	<script type="text/babel">	
	// 属性使用jsx	和函数的使用
	let url = {
	  baidu: 'http://www.baidu.com',
	  taobao: 'http://www.taobao.com'
	};
	function allname(vip) {
		if(vip==0){
			return <a href={url.baidu}>{url.baidu}</a>;
		}else{
			return <a href={url.taobao}>{url.taobao}</a>;
		}
	}
	let num =1
	let element = <a href={allname(num)}>{allname(num)}</a>
	
	ReactDOM.render(
	  element,
	  document.getElementById('test1')
	);
	</script>
</body>
</html>